home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / Patches.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  4.2 KB  |  159 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Patches.h
  3.  
  4.      Contains:    Patch Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 8
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17.  
  18. #ifndef __PATCHES__
  19. #define __PATCHES__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47. #if TARGET_OS_MAC
  48.  
  49. enum {
  50.     kOSTrapType                    = 0,
  51.     kToolboxTrapType            = 1
  52. };
  53.  
  54. typedef SignedByte                         TrapType;
  55.  
  56. enum {
  57.     OSTrap                        = kOSTrapType,                    /* old name */
  58.     ToolTrap                    = kToolboxTrapType                /* old name */
  59. };
  60.  
  61. /*
  62.     GetTrapAddress and SetTrapAddress are obsolete and should not
  63.     be used. Always use NGetTrapAddress and NSetTrapAddress instead.
  64.     The old routines will not be supported for PowerPC apps.
  65. */
  66. #if TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  67.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  68.                                                                                             #pragma parameter __A0 GetTrapAddress(__D0)
  69.                                                                                             #endif
  70. EXTERN_API( UniversalProcPtr )
  71. GetTrapAddress                    (UInt16                 trapNum)                            ONEWORDINLINE(0xA146);
  72.  
  73.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  74.                                                                                             #pragma parameter SetTrapAddress(__A0, __D0)
  75.                                                                                             #endif
  76. EXTERN_API( void )
  77. SetTrapAddress                    (UniversalProcPtr         trapAddr,
  78.                                  UInt16                 trapNum)                            ONEWORDINLINE(0xA047);
  79.  
  80. #endif  /* TARGET_CPU_68K && !TARGET_RT_MAC_CFM */
  81.  
  82. EXTERN_API( UniversalProcPtr )
  83. NGetTrapAddress                    (UInt16                 trapNum,
  84.                                  TrapType                 tTyp);
  85.  
  86. EXTERN_API( void )
  87. NSetTrapAddress                    (UniversalProcPtr         trapAddr,
  88.                                  UInt16                 trapNum,
  89.                                  TrapType                 tTyp);
  90.  
  91.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  92.                                                                                             #pragma parameter __A0 GetOSTrapAddress(__D0)
  93.                                                                                             #endif
  94. EXTERN_API( UniversalProcPtr )
  95. GetOSTrapAddress                (UInt16                 trapNum)                            ONEWORDINLINE(0xA346);
  96.  
  97.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  98.                                                                                             #pragma parameter SetOSTrapAddress(__A0, __D0)
  99.                                                                                             #endif
  100. EXTERN_API( void )
  101. SetOSTrapAddress                (UniversalProcPtr         trapAddr,
  102.                                  UInt16                 trapNum)                            ONEWORDINLINE(0xA247);
  103.  
  104.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  105.                                                                                             #pragma parameter __A0 GetToolTrapAddress(__D0)
  106.                                                                                             #endif
  107. EXTERN_API( UniversalProcPtr )
  108. GetToolTrapAddress                (UInt16                 trapNum)                            ONEWORDINLINE(0xA746);
  109.  
  110.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  111.                                                                                             #pragma parameter SetToolTrapAddress(__A0, __D0)
  112.                                                                                             #endif
  113. EXTERN_API( void )
  114. SetToolTrapAddress                (UniversalProcPtr         trapAddr,
  115.                                  UInt16                 trapNum)                            ONEWORDINLINE(0xA647);
  116.  
  117.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  118.                                                                                             #pragma parameter __A0 GetToolboxTrapAddress(__D0)
  119.                                                                                             #endif
  120. EXTERN_API( UniversalProcPtr )
  121. GetToolboxTrapAddress            (UInt16                 trapNum)                            ONEWORDINLINE(0xA746);
  122.  
  123.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  124.                                                                                             #pragma parameter SetToolboxTrapAddress(__A0, __D0)
  125.                                                                                             #endif
  126. EXTERN_API( void )
  127. SetToolboxTrapAddress            (UniversalProcPtr         trapAddr,
  128.                                  UInt16                 trapNum)                            ONEWORDINLINE(0xA647);
  129.  
  130. #if TARGET_CPU_PPC
  131. EXTERN_API( UniversalProcHandle )
  132. GetTrapVector                    (UInt16                 trapNumber);
  133.  
  134. #endif  /* TARGET_CPU_PPC */
  135.  
  136. #endif  /* TARGET_OS_MAC */
  137.  
  138.  
  139. #if PRAGMA_STRUCT_ALIGN
  140.     #pragma options align=reset
  141. #elif PRAGMA_STRUCT_PACKPUSH
  142.     #pragma pack(pop)
  143. #elif PRAGMA_STRUCT_PACK
  144.     #pragma pack()
  145. #endif
  146.  
  147. #ifdef PRAGMA_IMPORT_OFF
  148. #pragma import off
  149. #elif PRAGMA_IMPORT
  150. #pragma import reset
  151. #endif
  152.  
  153. #ifdef __cplusplus
  154. }
  155. #endif
  156.  
  157. #endif /* __PATCHES__ */
  158.  
  159.